package mapreduce;

import java.util.Iterator;
import java.util.Vector;

import mapreduce.JobConf;
import mapreduce.Task;


public class MultiTask extends Task {

	public MultiTask getMultiTask(int id){
		return new MultiTask(null, id);
	}
	
	public void run(){
		Iterator<Task> taskIt = m_tasks.iterator();
		while(taskIt.hasNext()){
			Task task = taskIt.next();
			System.out.println(task.toString() + " running......");
			task.run();
		}
	}
	
	public void addTask(Task task){
		m_tasks.add(task);
	}
	
	protected MultiTask(JobConf conf, int id) {
		super(conf, id);
	}
	
	protected Vector<Task> m_tasks = new Vector<Task>();

}
